<?php
/**
 * Template Name: 说说页面
 */
get_header();
?>
<div class="layui-show-md-inline-block layui-col-md8 layui-col-xs12">
    <div class="layui-card">
        <div class="layui-card-header" id="postd">
            <h3><?php the_title();?></h3>
        <?php get_template_part('advance/post', 'mate');?>
        </div>
        <div class="layui-card-body" style="float: right;overflow:auto;">
            <?php
            $the_query = new WP_Query("post_type=shuoshuo&post_status=publish&posts_per_page=-1");
            $year      = 0;
            $mon       = 0;
            $i         = 0;
            $j         = 0;
            while ($the_query->have_posts()): $the_query->the_post();
                $year_tmp = get_the_time('Y');
                $mon_tmp  = get_the_time('m');
                $y        = $year;
                $m        = $mon;
                if ($year != $year_tmp) {
                    $year = $year_tmp;
                }
                if ($mon != $mon_tmp) {
                    $mon = $mon_tmp;
                }
                echo '<span class="layui-badge layui-bg-gray">' . $year . '年' . $mon . '月'.get_the_time('d日').'</span>';
                echo '<div class="bubbler" style="margin-bottom:10px"><strong>'. get_the_title() . '</strong><br>';
                the_content();
                echo '</div><div style="clear:both;"></div>';
            endwhile;
            wp_reset_postdata();
            ?>
        </div>
        <div style="clear:both"></div>
    </div>
</div>
<?php get_sidebar();?>
<?php get_footer();?>